import {defineConfig} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import {resolve} from 'path'
import AutoImport from 'unplugin-auto-import/vite'
const alias = {
  '@/': resolve(__dirname, 'src/')
}

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    uni(),
    AutoImport({
      imports: ['vue', 'uni-app'],
      dts: 'src/auto-import.d.ts',
      dirs: ['src/utils/global'], // 自动导入 hooks
      eslintrc: {enabled: true}
    })
  ],
  resolve: {
    alias
  }
})
